module DeliveryStatus
  SENDING = :sending
  COMPLETE = :complete
  PAUSE = :pause
  NOT_STARTED = :not_started

  def self.each(&block)
    to_a.each(&block)
  end

  def self.to_a
    @ary ||= constants.map{|c| const_get(c)}.sort
  end

  self.each do |st|
    define_method :"#{st}?" do
      /^#{st}$/i === status
    end
  end

end